Grid4

A = (4.05074617751095, 3.185495927938695)
B = (4.443686830042935, 3.340290730451296)
d_{AB} = Distance(A, B)
θ: atan(Slope[Line[A, B]])
a = Line(A, B)
m = 4 (slider from 0 to 10, step 1)
n = 3 (slider from 0 to 10, step 1)
GridParallelABneg = Sequence((x(A) - n * d_{AB} * cos(θ) - i * d_{AB} * sin(θ), y(A) - n * d_{AB} * sin(θ) + i * d_{AB} * cos(θ)), i, -m, m)
GridParallelABpos = Sequence((x(A) + n * d_{AB} * cos(θ) - i * d_{AB} * sin(θ), y(A) + n * d_{AB} * sin(θ) + i * d_{AB} * cos(θ)), i, -m, m)
GridPerpABpos = Sequence((x(A) - m * d_{AB} * sin(θ) + j * d_{AB} * cos(θ), y(A) + m * d_{AB} * cos(θ) + j * d_{AB} * sin(θ)), j, -n, n)
GridPerpABneg = Sequence((x(A) + m * d_{AB} * sin(θ) + j * d_{AB} * cos(θ), y(A) - m * d_{AB} * cos(θ) + j * d_{AB} * sin(θ)), j, -n, n)
b = OrthogonalLine(A, a)